/**
 * 
 */
package com.googlecode.pcapj;

import java.io.Closeable;
import java.io.IOException;

/**
 * Represent a writer of a dump file. 
 */
public interface DumpFileWriter extends Closeable{
	/**
	 * Starts capturing packets and dumping to a file. 
	 * @param dumpFilter a filter to dump packet, or null if dose not filter.
	 * @return true if a break method is called.     
	 */
	boolean loop(DumpFilter dumpFilter)throws IOException;
	/**
	 * Reads a captured packet and gets a CapturedWriter object. 
	 * @return a CapturedWriter object, or null if EOF was reached reading from an off-line capture.
	 * @throws PcapJTimeoutException
	 * @throws IOException
	 */
	public CapturedWriter read() throws PcapJTimeoutException, IOException;
	/**
	 * 
	 */
	void breakLoop()throws IOException;
}
